package com.dsx.test.web;

import com.dsx.test.model.LoginUserReq;
import com.dsx.test.service.LoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : tianwenqing
 * @version : 1.0
 * @date : 2020-11-16 18:39
 * @description :
 **/
@Slf4j
@RestController
@RequestMapping(value = "/api")
public class LoginController {

    @Autowired
    private LoginService loginService ;

    @PostMapping("/login")
    public String login(@RequestBody LoginUserReq loginUserReq){
        String login = loginService.login(loginUserReq);
        return login ;
    }

    @PostMapping("/perm")
    public String perm(@RequestBody LoginUserReq loginUserReq){
        String login = loginService.login(loginUserReq);
        return login ;
    }

    @PostMapping("/noperm")
    public String noperm(){
        return "你好" ;
    }
}
